#include <iostream>
using namespace std;
int main() {
  int n = 5, m = 5;
  int a[n][m];
  for (auto& line : a) {
    for (auto& x : line) {
      cin >> x;
    }
  }
  bool found = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      bool isMax = true, isMin = true;
      for (int k = 0; k < m; k++) {
        if (a[i][k] > a[i][j]) {
          isMax = false;
          break;
        }
      }
      for (int k = 0; k < n; k++) {
        if (a[k][j] < a[i][j]) {
          isMin = false;
          break;
        }
      }
      if (isMax && isMin) {
        cout << i + 1 << ' ' << j + 1 << ' ' << a[i][j] << endl;
        found = true;
      }
    }
  }
  if (!found) cout << "not found" << endl;
}